<?php
/* @var $this ScheduleController */
/* @var $model Schedule */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'schedule-form',
	'enableAjaxValidation'=>false,
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,)	
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>


	<div class="row">
		<?php echo $form->labelEx($model,'idweekday'); ?>
		<?php echo $form->dropDownList($model,
									   'idweekday',
									   CHtml::listData(Weekday::model()->findAll(),'idweekday','name'),
									   array('empty'=>'','class'=>'dropteam')
									   ); ?>
		<?php echo $form->error($model,'idweekday'); ?>
	</div>	

	<div class="row">
		<?php echo $form->labelEx($model,'idshift'); ?>
		<?php echo $form->dropDownList($model,
									   'idshift',
									   CHtml::listData(Shift::model()->findAll(array('condition'=>'team_id = '.Yii::app()->user->team_id)),'idshift','name','start_time'),
									   array('empty'=>'',
											 'class'=>'dropteam',)
									   ); ?>
		<?php echo $form->error($model,'idshift'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'idqshift'); ?>
		<?php echo $form->dropDownList($model,
									   'idqshift',
									   CHtml::listData(QShift::model()->findAll(array('condition'=>'team_id = '.Yii::app()->user->team_id)),'idqshift','name'),
									   array('empty'=>'','class'=>'dropteam')
									   ); ?>
		<?php echo $form->error($model,'idqshift'); ?>
	</div>

<br>
	<div class="buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->